package com.yly.common.basic.dao;

import java.sql.Connection;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;

import com.yly.utils.StrUtil;

public class BasicDao extends SqlSessionDaoSupport {

	@Resource(name = "sqlSessionTemplate")
	public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
		super.setSqlSessionTemplate(sqlSessionTemplate);
	}
	
	/**
	 * 
	 * <p>Title: 获得数据库连接对象</p>
	 * <p>Description: 获得数据库连接对象</p>
	 * @return 数据库连接对象
	 */
	public Connection getConnection(){
		return this.getSqlSession().getConnection();
	}
	
	/**
	 * <p>Title: 生成UUID</p>
	 * <p>Description: 生成UUID</p>
	 * @return 生成的UUID
	 */
	protected String getUUID() {
		return StrUtil.getUUID();
	}
}
